<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="<?=ADMIN_RES_PATH ?>/css/default/admin.css" rel="stylesheet" type="text/css">
<script src="<?=ADMIN_RES_PATH ?>/js/jquery-1.7.1.js" type="text/javascript"></script>
<script src="<?=ADMIN_RES_PATH ?>/js/public.js" type="text/javascript"></script>
</head>
<style type="text/css">
#main .search{width:98%; height:30px; line-height:30px; border: 1px solid #BBDDE5; background:#F4FAFB; margin-top:2px;}
img{margin:0 4px; vertical-align:middle}
td a{}
td a:hover{color:ee0000;}
</style>
<body>
    <?php
        $artlist = $this->articles;
        $tblcate = $this->tblcate;
        $filterid = $this->filterid;
    ?>
    <div id="main">
    	<div class="title">文章管理</div>
    	<div class="content">
        <span>
    	<form method="post" action="<?=ADMIN_PATH ?>/Article/filter" enctype="multipart/form-data">
    		<span>过滤：</span>
    		<span>分类</span>
    		<select name="cateid" class="select">
    			<option value="0" >全部</option>
                <?php foreach($tblcate->getCates() as $cate ){ ?>
    			<option value="<?=$cate['id'] ?>" <?php if($cate['id']==$filterid) echo 'selected="selected"'; ?> ><?=$cate['name'] ?> </option>
    			<?php } ?>
    		</select>
    		<input type="submit" class="sub" value="查询"/>
    	</form>
    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" style="margin-top:2px;" class="mytab">
      <tr style="background:#BBDDE5" id="h">
        <td width="15%" align="center">ID</td>
        <td width="15%" align="center">分类</td>
        <td width="40%" align="center">标题</td>
    	<td width="15%" align="center">日期</td>
        <td width="15%" align="center">操作</td>
      </tr>
     <?php foreach($artlist as $art ){ ?>
      <tr class="newtr">
         <td width="15%" align="center"><?=$art['id'] ?></td>
        <td width="15%" align="center"><?=$tblcate->getCateName($art['cateid']) ?></td>
        <td width="40%" align="center"><?=$art['title'] ?></td>
    	<td width="15%" align="center"><?=date("Y-m-d H:i",$art['posttime']) ?></td>
        <td width="15%" align="center">
            <a href="<?=ADMIN_PATH ?>/Article/edit/id/<?=$art['id'] ?>">修改</a>&nbsp;&nbsp;
            <a href="<?=ADMIN_PATH ?>/Article/top/id/<?=$art['id'] ?>">置顶</a>&nbsp;&nbsp;
            <a href="<?=ADMIN_PATH ?>/Article/del/id/<?=$art['id'] ?>" onClick="return confirm('您确定要删除该文章吗？')">删除</a>
        </td>

      </tr>
     <?php } ?>
    </table>

    </span>
    	</div>
    </div>
</body>
</html>
